home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / xinetd / xinetd.2.0.6 / state.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-22  |  1.8 KB  |  79 lines

  1. /*
  2.  * (c) Copyright 1992 by Panagiotis Tsirigotis
  3.  * All rights reserved.  The file named COPYRIGHT specifies the terms 
  4.  * and conditions for redistribution.
  5.  */
  6.  
  7. #ifndef STATE_H
  8. #define STATE_H
  9.  
  10. /*
  11.  * $Id: state.h,v 5.1 1992/10/31 23:59:07 panos Exp $
  12.  */
  13.  
  14. #include <setjmp.h>
  15.  
  16. #include "pset.h"
  17. #include "xlog.h"
  18.  
  19. #include "mask.h"
  20. #include "service.h"
  21.  
  22. struct read_only_state
  23. {
  24.     int orig_max_descriptors ;            /* before we change the resource limit */
  25.     int max_descriptors ;                /* as returned by getdtablesize()         */
  26.     int process_limit ;                    /* if 0, there is no limit                 */
  27.     unsigned loop_rate ;
  28.     char *config_file ;
  29.     int is_superuser ;
  30.     char **Argv ;
  31.     int Argc ;
  32. } ;
  33.  
  34.  
  35. struct config_state
  36. {
  37.    struct service *defaults ;
  38.    xlog_h common_log ;
  39.    bool_int common_log_creation_failed ;
  40. } ;
  41.  
  42.  
  43. struct read_write_state
  44. {
  45.     int descriptors_free ;
  46.     int available_services ;            /* # of available services                 */
  47.     int active_services ;                /* services with descriptors set in     */
  48.                                                 /* socket mask                                    */
  49.     fd_set socket_mask ;
  50.     int mask_max ;
  51.     pset_h servers ;                        /* table of running servers                */
  52.     pset_h retries ;                        /* table of servers to retry                */
  53.     pset_h services ;                        /* table of services                            */
  54.     struct service *logging ;
  55.     struct service *shutdown ;
  56.     struct config_state cs ;
  57.     xlog_h program_log ;
  58.     jmp_buf env ;
  59.     bool_int env_is_valid ;
  60. } ;
  61.  
  62. struct program_state
  63. {
  64.     mask_t flags ;
  65.     struct read_only_state ros ;
  66.     struct read_write_state rws ;
  67. } ;
  68.  
  69. #define DEFAULTS( ps )                        CONF( (ps).rws.cs.defaults )
  70. #define DEFAULT_LOG( ps )                    (ps).rws.cs.common_log
  71. #define DEFAULT_LOG_ERROR( ps )            (ps).rws.cs.common_log_creation_failed
  72. #define LOG_SERVICE( ps )                    (ps).rws.logging
  73. #define SHUTDOWN_SERVICE( ps )            (ps).rws.shutdown
  74. #define SERVICES( ps )                        (ps).rws.services
  75.  
  76. extern struct program_state ps ;
  77.  
  78. #endif    /* STATE_H */
  79.